<template>
	<view class="commodity">
	<!-- 	<uni-nav-bar title="意见反馈" left-icon="left" @clickLeft="navBack" backgroundColor="#2CB9A4" color="#F8F8F8"></uni-nav-bar> -->
		<view class="todayInfo">
			<view class="item" v-for="(i,index) in todayList">
				<view class="">
					<image :src="i.url" mode="" class="image"></image>
				</view>
				<view class="topName">
					{{i.name}}
				</view>
				<view class="sum">
					<text class="dolar" v-if="i.dolar">￥</text>{{i.num}}
				</view>
			</view>
		</view>
		<view class="list f-column" v-for="(item,index) in list" :key="index">
			<view class="list_item" :style="{background:item.status==1?'#2CB9A4':'#fff'}">
				<view class="content">
					<view class="item">
						<view class="icon">
							<image :src="item.image" mode="" class="image"></image>
						</view>
						<view class="entityList">
							<view class="topName" style="font-size: 32rpx;">
								<text class="text">{{item.name}}</text>
								<view class="right" style="color: #2CB9A4;">
									<u-rate :value="item.score"  :disabled = "true"activeColor="#FA3534" inactiveColor="#b2b2b2"></u-rate>
								</view>
							</view>
							<view class="name">
								<text class="text">{{item.evaluate_time}}</text>
								<view class="right">
									
								</view>
							</view>
							<view class="name">
								
								<view class="right" style="width: 30%;">
									
								</view>
							</view>
						</view>
					</view>
					<view class="commodiyBot">
						{{item.evaluate}}
					</view>
				</view>
			</view>
		</view>
		<view class="noMore" v-if="last_page==form.page&&list.length!=0"
			style="text-align: center;color: #797575;margin-top: 20rpx;padding-bottom: 60rpx;">
			数据加载完成...
		</view>
		<u-empty text="暂无列表哦~~" mode="list" v-if="list.length==0" margin-top='50'></u-empty>
	</view>
</template>

<script>
	import {
		washlogList
	} from '@/request/api.js'
	export default {
		data() {
			return {
				todayList: [{
					url:'../../static/icon/my/star3.png',
					name: '好评',
					num: '50'
				}, {
					url:'../../static/icon/my/star2.png',
					name: '中评',
					num: '50',
					dolar: false
				}, {
					url:'../../static/icon/my/star1.png',
					name: '差评',
					num: '50',
					dolar: false
				}],
				value1: true,
				list: [
				],
				form: {
					page: 1,
				},
				last_page: 1,
			};
		},
		onReachBottom() {
			// console.log(111)
			if (this.form.page < this.last_page) {
				this.form.page = this.form.page + 1
				this.getWashlogList()
			}
		},
		onLoad() {
			this.getWashlogList()
		},
		methods: {
			async getWashlogList(){
				let res = await washlogList()
				this.todayList[0].num = res.data.score[0].value
				this.todayList[1].num = res.data.score[1].value
				this.todayList[2].num = res.data.score[2].value
				this.list = this.list.concat(res.data.data.data)
				this.last_page = res.data.data.last_page
				console.log(res,111)
			},
			addCommodity() {
				uni.navigateTo({
					url: '/my_pages/addCommInfo/addCommInfo'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .u-input {
		padding-top: 2px !important;
		padding-bottom: 2px !important;
	}

	.commodity {
		font-size: 28rpx;
		padding: 20rpx;
		.todayInfo {
			display: flex;
			justify-content: space-around;
			align-items: center;
			box-shadow: 0px 0px 10px rgba(8, 23, 56, 0.05);
			border-radius: 8px;
			padding: 20rpx;
		
			.item {
				display: flex;
				flex-direction: column;
				align-items: center;
		
				.topName {
					color: #ca5b26;
					margin-top: 10rpx;
				}
		
				.sum {
					color: #ea9518;
					margin-top: 10rpx;
				}
				.image{
					    height: 60rpx;
					    width: 60rpx;
				}
			}
		}
		.add {
			color: #2CB9A4;
			background: #C0EAE4;
			box-shadow: 0px 0px 10px rgba(8, 23, 56, 0.05);
			border-radius: 8px;
			padding: 20rpx;

			.item {}
		}

		.list {
			margin-top: 20rpx;

			.content {
				background-color: #fff;
				// box-shadow: 0px 0px 10px rgba(8, 23, 56, 0.05);
				border-radius: 10px;
				// padding: 20rpx;
				margin-top: 20rpx;

				.conBot {
					align-items: flex-end;

					.f-row {
						display: flex;
						align-items: flex-end;
					}

					.goNear {
						background: #2CB9A4;
						color: #fff;
						height: 60rpx;
						justify-content: center;
						align-items: center;
						border-radius: 10rpx;
						padding: 10rpx 20rpx;
						font-size: 32rpx;
						align-items: center;
					}

					display: flex;
					justify-content: space-between;
					color: #2CB9A4;

					.down {
						background: #C0EAE4;
						justify-content: center;
						display: flex;
						flex-direction: column;
						align-items: center;
						padding: 10rpx;
						font-size: 22rpx;
						border-radius: 10rpx;
						margin-right: 10rpx;
					}

					.down_price {
						margin-right: 10rpx;
					}

					.price {
						margin-right: 10rpx;
					}
				}
			}

			.list_item {
				display: flex;
				flex-direction: column;
				background: #2CB9A4;
				border-radius: 20rpx;
				padding: 20rpx;

				.title {
					color: #fff;
					font-size: 30rpx;
					font-weight: 600;
				}

				.item {
					display: flex;
					color: #505050;
					margin: 15rpx 0;
					border-bottom: 0.5px solid rgba(217, 217, 217, 0.3);
					padding-bottom: 15rpx;
					box-sizing: border-box;
					background: #fff;
					border-radius: 20rpx;

					.icon {
						width: 72rpx;
						height: 72rpx;
						width: 100rpx;
						height: 100rpx;

						.image {
							width: 100%;
							height: 100%;
						}
					}

					.entityList {
						flex: 1;
						display: flex;
						flex-direction: column;
						overflow: hidden;
						text-overflow: ellipsis;
						justify-content: space-between;

						.name {
							display: flex;
							justify-content: space-between;
							margin-left: 15rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							color: #BABABA;
							font-size: 26rpx;
							margin-top: 10rpx;

							.text {
								width: 60%;
								overflow: hidden;
								text-overflow: ellipsis;
								white-space: nowrap;
							}

							.image {
								width: 26rpx;
								height: 26rpx;
								margin-right: 10rpx;
							}
						}

						.topName {
							display: flex;
							justify-content: space-between;
							margin-left: 15rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							color: #000;
							font-weight: 600;
							font-size: 26rpx;

							.text {
								width: 60%;
								overflow: hidden;
								text-overflow: ellipsis;
								white-space: nowrap;
							}

							.image {
								width: 26rpx;
								height: 26rpx;
								margin-right: 10rpx;
							}
						}
					}
				}

				.commodiyBot {
					display: flex;
					// flex-direction: row-reverse;
					color: #BABABA;
					.botBtn {
						margin-left: 30rpx;
					}
				}
			}
		}
	}
</style>